package wang.chunfan.springcloud.learning.stream.rabbitmq.client;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.messaging.support.MessageBuilder;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import wang.chunfan.springcloud.learning.stream.rabbitmq.processor.RabbitProcessor;

import java.util.HashMap;
import java.util.Map;

@RestController
public class Producer {
    @Autowired
    RabbitProcessor rabbitProcessor;

    @GetMapping("send")
    public void send() {
        Map map = new HashMap();
        map.put("1", "1");
        map.put("2", "2");
        rabbitProcessor.outputTest().send(MessageBuilder.withPayload(map).build());
    }
}
